
from flask import Flask, jsonify, request
import json
import sys

app = Flask(__name__)
# predict是对客户端的不同请求的命名，也可以是get_data,print,save等等
@app.route('/', methods=['POST'])
# @app.route('/',methods = ['POST'])

def predict():
    if request.method == 'POST':

        data = request.form.get('diameter')
        print(data)
        file = request.files.get('measureImg')
        file.save("file1.jpg")
        print(file)

        return jsonify({'result': ' GOT RESULT'})


if __name__ == '__main__':
    app.run(host='127.0.0.1', port=5000)
